<%--
  Created by IntelliJ IDEA.
  User: hnjy
  Date: 2025/2/27
  Time: 11:19
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>宠物领养信息确认</title>
    <style>
        body {
            font-family: Arial, sans-serif;
        }

        form {
            width: 400px;
            margin: 0 auto;
            padding: 20px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
        }

        label {
            display: block;
            margin-bottom: 5px;
        }

        input,
        textarea {
            width: 100%;
            padding: 8px;
            margin-bottom: 15px;
            border: 1px solid #ccc;
            border-radius: 3px;
        }

        button {
            padding: 10px 20px;
            background-color: #007BFF;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }

        button:hover {
            background-color: #0056b3;
        }
    </style>
</head>

<body>

<form id="adoptForm" action="${pageContext.request.contextPath}/sys/apply/addApply" method="post">
    <input type="hidden" value="${petId}" name="petId"/>
    <label for="adopter">领养人：</label>
    <input type="text" id="adopter" value="张乐乐" name="name">
    <label for="petName">宠物名：</label>
    <input type="text" id="petName" value="kitty"  name="petName">

    <label for="phone">电话：</label>
    <input type="text" id="phone" value="13908457344"  name="telephone">
    <label for="email">邮件：</label>
    <input type="email" id="email" value="2589878557@qq.com"  name="email">
    <label for="address">地址：</label>
    <input type="text" id="address" value="北京市"  name="address">
    <label for="reason">理由：</label>
    <textarea id="reason" placeholder="请输入领养理由"  name="message"></textarea>
    <button type="button" id="closeBtn" onclick="history.back()">返回</button>
    <button type="submit" id="submitBtn">提交申请</button>
</form>
<script>
    // document.getElementById('closeBtn').addEventListener('click', function () {
    //     // 这里可添加关闭窗口或跳转到其他页面的逻辑
    //     window.close();
    // });
    //
    // document.getElementById('submitBtn').addEventListener('click', function (e) {
    //     e.preventDefault();
    //     const formData = {
    //         name: document.getElementById('adopter').value,
    //         email: document.getElementById('email').value,
    //         telephone: document.getElementById('phone').value,
    //         message: document.getElementById('reason').value,
    //         // 这里age和applyTime、state需要根据实际情况补充，当前示例先设为null
    //         age: null,
    //         applyTime: null,
    //         state: null
    //     };
    //     // 这里可添加AJAX代码将数据发送到后端
    //     console.log('准备提交的数据：', formData);
    // });
</script>
</body>

</html>
